package com.vdm.service.impl;

import com.vdm.dao.SalesmanInfoMapper;
import com.vdm.model.SalesmanInfo;
import com.vdm.service.SalesmanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalesmanServiceImpl implements SalesmanService {

    @Autowired
    SalesmanInfoMapper salesmanInfoMapper;

    @Override
    public List<SalesmanInfo> salesmanInfoList() {
        return salesmanInfoMapper.salesmanInfoList();
    }

    @Override
    public List<SalesmanInfo> getAllSalesmanInfo() {
        return salesmanInfoMapper.getAllSalesmanInfo();
    }

    @Override
    public int getSalesmanInfoCount() {
        return salesmanInfoMapper.getSalesmanInfoCount();
    }

    @Override
    public int updateSalesmanInfoStatus(List<Integer> ids, Integer type) {
        if (ids != null && ids.size() > 0) {
            return salesmanInfoMapper.updateSalesmanInfoStatus(ids, type);
        } else {
            return 0;
        }
    }

    @Override
    public int updateByPk(SalesmanInfo salesmanInfo) {
        return salesmanInfoMapper.updateByPrimaryKeySelective(salesmanInfo);
    }

    @Override
    public int insertSelective(SalesmanInfo salesmanInfo) {
        return salesmanInfoMapper.insertSelective(salesmanInfo);
    }
}
